<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GdkDisplayManager: GDK 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GDK 3 Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk3-General.html" title="General">
<link rel="next" href="GdkDisplay.html" title="GdkDisplay">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#GdkDisplayManager.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#GdkDisplayManager.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties">  <span class="dim">|</span> 
                  <a href="#GdkDisplayManager.properties" class="shortcut">Properties</a></span><span id="nav_signals">  <span class="dim">|</span> 
                  <a href="#GdkDisplayManager.signals" class="shortcut">Signals</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gdk3-General.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="GdkDisplay.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="GdkDisplayManager"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GdkDisplayManager.top_of_page"></a>GdkDisplayManager</span></h2>
<p>GdkDisplayManager — Maintains a list of all open GdkDisplays</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="GdkDisplayManager.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="returnvalue">GdkDisplayManager</span></a> *
</td>
<td class="function_name">
<a class="link" href="GdkDisplayManager.html#gdk-display-manager-get" title="gdk_display_manager_get ()">gdk_display_manager_get</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="returnvalue">GdkDisplay</span></a> *
</td>
<td class="function_name">
<a class="link" href="GdkDisplayManager.html#gdk-display-manager-get-default-display" title="gdk_display_manager_get_default_display ()">gdk_display_manager_get_default_display</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="GdkDisplayManager.html#gdk-display-manager-set-default-display" title="gdk_display_manager_set_default_display ()">gdk_display_manager_set_default_display</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GSList</span> *
</td>
<td class="function_name">
<a class="link" href="GdkDisplayManager.html#gdk-display-manager-list-displays" title="gdk_display_manager_list_displays ()">gdk_display_manager_list_displays</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="returnvalue">GdkDisplay</span></a> *
</td>
<td class="function_name">
<a class="link" href="GdkDisplayManager.html#gdk-display-manager-open-display" title="gdk_display_manager_open_display ()">gdk_display_manager_open_display</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.properties"></a><h2>Properties</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="properties_type">
<col width="300px" class="properties_name">
<col width="200px" class="properties_flags">
</colgroup>
<tbody><tr>
<td class="property_type">
<a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *</td>
<td class="property_name"><a class="link" href="GdkDisplayManager.html#GdkDisplayManager--default-display" title="The “default-display” property">default-display</a></td>
<td class="property_flags">Read / Write</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.signals"></a><h2>Signals</h2>
<div class="informaltable"><table class="informaltable" border="0">
<colgroup>
<col width="150px" class="signal_proto_type">
<col width="300px" class="signal_proto_name">
<col width="200px" class="signal_proto_flags">
</colgroup>
<tbody><tr>
<td class="signal_type"><span class="returnvalue">void</span></td>
<td class="signal_name"><a class="link" href="GdkDisplayManager.html#GdkDisplayManager-display-opened" title="The “display-opened” signal">display-opened</a></td>
<td class="signal_flags">Run Last</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="GdkDisplayManager.html#GdkDisplayManager-struct" title="GdkDisplayManager">GdkDisplayManager</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    GObject
    <span class="lineart">╰──</span> GdkDisplayManager
</pre>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;gdk/gdk.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.description"></a><h2>Description</h2>
<p>The purpose of the <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> singleton object is to offer
notification when displays appear or disappear or the default display
changes.</p>
<p>You can use <a class="link" href="GdkDisplayManager.html#gdk-display-manager-get" title="gdk_display_manager_get ()"><code class="function">gdk_display_manager_get()</code></a> to obtain the <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a>
singleton, but that should be rarely necessary. Typically, initializing
GTK+ opens a display that you can work with without ever accessing the
<a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a>.</p>
<p>The GDK library can be built with support for multiple backends.
The <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> object determines which backend is used
at runtime.</p>
<p>When writing backend-specific code that is supposed to work with
multiple GDK backends, you have to consider both compile time and
runtime. At compile time, use the <a class="link" href="gdk3-General.html#GDK-WINDOWING-X11:CAPS" title="GDK_WINDOWING_X11"><span class="type">GDK_WINDOWING_X11</span></a>, <a class="link" href="gdk3-General.html#GDK-WINDOWING-WIN32:CAPS" title="GDK_WINDOWING_WIN32"><span class="type">GDK_WINDOWING_WIN32</span></a>
macros, etc. to find out which backends are present in the GDK library
you are building your application against. At runtime, use type-check
macros like <code class="function">GDK_IS_X11_DISPLAY()</code> to find out which backend is in use:</p>
<div class="refsect3">
<a name="backend-specific"></a><h4>Backend-specific code</h4>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="cp">#ifdef GDK_WINDOWING_X11</span>
  <span class="k">if</span> <span class="p">(</span><span class="n">GDK_IS_X11_DISPLAY</span> <span class="p">(</span><span class="n">display</span><span class="p">))</span>
    <span class="p">{</span>
      <span class="c1">// make X11-specific calls here</span>
    <span class="p">}</span>
  <span class="k">else</span>
<span class="cp">#endif</span>
<span class="cp">#ifdef GDK_WINDOWING_QUARTZ</span>
  <span class="k">if</span> <span class="p">(</span><span class="n">GDK_IS_QUARTZ_DISPLAY</span> <span class="p">(</span><span class="n">display</span><span class="p">))</span>
    <span class="p">{</span>
      <span class="c1">// make Quartz-specific calls here</span>
    <span class="p">}</span>
  <span class="k">else</span>
<span class="cp">#endif</span>
  <span class="n">g_error</span> <span class="p">(</span><span class="s">&quot;Unsupported GDK backend&quot;</span><span class="p">);</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p></p>
</div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="gdk-display-manager-get"></a><h3>gdk_display_manager_get ()</h3>
<pre class="programlisting"><a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="returnvalue">GdkDisplayManager</span></a> *
gdk_display_manager_get (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>Gets the singleton <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> object.</p>
<p>When called for the first time, this function consults the
<code class="literal">GDK_BACKEND</code> environment variable to find out which
of the supported GDK backends to use (in case GDK has been compiled
with multiple backends). Applications can use <a class="link" href="gdk3-General.html#gdk-set-allowed-backends" title="gdk_set_allowed_backends ()"><code class="function">gdk_set_allowed_backends()</code></a>
to limit what backends can be used.</p>
<div class="refsect3">
<a name="gdk-display-manager-get.returns"></a><h4>Returns</h4>
<p>The global <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> singleton;
<a class="link" href="gdk3-General.html#gdk-parse-args" title="gdk_parse_args ()"><code class="function">gdk_parse_args()</code></a>, <a class="link" href="gdk3-General.html#gdk-init" title="gdk_init ()"><code class="function">gdk_init()</code></a>, or <a class="link" href="gdk3-General.html#gdk-init-check" title="gdk_init_check ()"><code class="function">gdk_init_check()</code></a> must have
been called first. </p>
<p><span class="annotation">[<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-display-manager-get-default-display"></a><h3>gdk_display_manager_get_default_display ()</h3>
<pre class="programlisting"><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="returnvalue">GdkDisplay</span></a> *
gdk_display_manager_get_default_display
                               (<em class="parameter"><code><a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> *manager</code></em>);</pre>
<p>Gets the default <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>.</p>
<div class="refsect3">
<a name="gdk-display-manager-get-default-display.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>manager</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-display-manager-get-default-display.returns"></a><h4>Returns</h4>
<p>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>, or <code class="literal">NULL</code> if
there is no default display. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-display-manager-set-default-display"></a><h3>gdk_display_manager_set_default_display ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
gdk_display_manager_set_default_display
                               (<em class="parameter"><code><a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> *manager</code></em>,
                                <em class="parameter"><code><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *display</code></em>);</pre>
<p>Sets <em class="parameter"><code>display</code></em>
 as the default display.</p>
<div class="refsect3">
<a name="gdk-display-manager-set-default-display.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>manager</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>display</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-display-manager-list-displays"></a><h3>gdk_display_manager_list_displays ()</h3>
<pre class="programlisting"><span class="returnvalue">GSList</span> *
gdk_display_manager_list_displays (<em class="parameter"><code><a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> *manager</code></em>);</pre>
<p>List all currently open displays.</p>
<div class="refsect3">
<a name="gdk-display-manager-list-displays.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>manager</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-display-manager-list-displays.returns"></a><h4>Returns</h4>
<p>a newly
allocated <span class="type">GSList</span> of <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> objects. Free with <code class="function">g_slist_free()</code>
when you are done with it. </p>
<p><span class="annotation">[<acronym title="The caller owns the data container, but not the data inside it."><span class="acronym">transfer container</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GdkDisplay]</span></p>
</div>
<p class="since">Since: 2.2</p>
</div>
<hr>
<div class="refsect2">
<a name="gdk-display-manager-open-display"></a><h3>gdk_display_manager_open_display ()</h3>
<pre class="programlisting"><a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="returnvalue">GdkDisplay</span></a> *
gdk_display_manager_open_display (<em class="parameter"><code><a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> *manager</code></em>,
                                  <em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
<p>Opens a display.</p>
<div class="refsect3">
<a name="gdk-display-manager-open-display.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>manager</p></td>
<td class="parameter_description"><p>a <a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>name</p></td>
<td class="parameter_description"><p>the name of the display to open</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="gdk-display-manager-open-display.returns"></a><h4>Returns</h4>
<p>a <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>, or <code class="literal">NULL</code> if the
display could not be opened. </p>
<p><span class="annotation">[<acronym title="NULL may be passed as the value in, out, in-out; or as a return value."><span class="acronym">nullable</span></acronym>][<acronym title="The data is owned by the callee, which is responsible of freeing it."><span class="acronym">transfer none</span></acronym>]</span></p>
</div>
<p class="since">Since: <a class="link" href="api-index-3-0.html#api-index-3.0">3.0</a></p>
</div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="GdkDisplayManager-struct"></a><h3>GdkDisplayManager</h3>
<pre class="programlisting">typedef struct _GdkDisplayManager GdkDisplayManager;</pre>
</div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GdkDisplayManager--default-display"></a><h3>The <code class="literal">“default-display”</code> property</h3>
<pre class="programlisting">  “default-display”          <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a> *</pre>
<p>The default display for GDK.</p>
<p>Owner: GdkDisplayManager</p>
<p>Flags: Read / Write</p>
</div>
</div>
<div class="refsect1">
<a name="GdkDisplayManager.signal-details"></a><h2>Signal Details</h2>
<div class="refsect2">
<a name="GdkDisplayManager-display-opened"></a><h3>The <code class="literal">“display-opened”</code> signal</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
user_function (<a class="link" href="GdkDisplayManager.html" title="GdkDisplayManager"><span class="type">GdkDisplayManager</span></a> *manager,
               <a class="link" href="GdkDisplay.html" title="GdkDisplay"><span class="type">GdkDisplay</span></a>        *display,
               <span class="type">gpointer</span>           user_data)</pre>
<p>The ::display-opened signal is emitted when a display is opened.</p>
<div class="refsect3">
<a name="GdkDisplayManager-display-opened.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>manager</p></td>
<td class="parameter_description"><p>the object on which the signal is emitted</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>display</p></td>
<td class="parameter_description"><p>the opened display</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>user_data</p></td>
<td class="parameter_description"><p>user data set when the signal handler was connected.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p>Flags: Run Last</p>
<p class="since">Since: 2.2</p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>